<?xml version="1.0" encoding="UTF-8"?>

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
     xmlns:h="http://java.sun.com/jsf/html"
     xmlns:ui="http://java.sun.com/jsf/facelets"
     xmlns:p="http://primefaces.org/ui"
     xmlns:a="http://xmlns.jcp.org/jsf/passthrough"
     template="TemplateFrontEnd.xhtml">
<ui:define name="title">Test bid</ui:define>
<ui:define name="body" >
<h:form>
<p:inputText value="#{bidMB.idClient}" />
<p:panelGrid id="exp" columns="1"  style="width: 100%;">
<p:commandButton update="exp" value="rafraichir" action="#{bidMB.EspaceExpediteur()}" />
<p:outputLabel value="Espace Expéditeur" />

<p:dataTable var="a" value="#{bidMB.listeOffres()}" >
<f:facet name="header">Offres</f:facet>
<p:column headerText="IdOffre">
<p:outputLabel value="#{a.idOffre}" />
</p:column>
<p:column headerText="action">
</p:column>

</p:dataTable>

<p:dataTable var="a" value="#{bidMB.listeDeclaration(1,'Exp')}" >
<f:facet name="header">Declarations </f:facet>
<p:column headerText="IdDeclaration">
<p:outputLabel value="#{a.idDeclaration}" />
</p:column>

<p:column headerText="carrier">
<p:outputLabel value="#{a.transporteur.nom}" />
</p:column>

<p:column headerText="prix">
<p:outputLabel value="#{a.price}" />
</p:column>

<p:column headerText="action">
<p:commandButton ajax="false" value="accept" action="#{bidMB.accepterDeclaration(a.idDeclaration,'Exp')}" />
<p:commandButton ajax="false" value="decline" action="#{bidMB.refuser(a.idDeclaration)}" />
</p:column>

</p:dataTable>

<p:dataTable var="a" value="#{bidMB.listeDeclaration(2,'Exp')}"  >
<f:facet name="header">Declarations Accepté</f:facet>
<p:column headerText="IdDeclaration">
<p:outputLabel value="#{a.idDeclaration}" />
</p:column>

<p:column headerText="carrier">
<p:outputLabel value="#{a.transporteur.nom}" />
</p:column>

<p:column headerText="prix">
<p:outputLabel value="#{a.price}" />
</p:column>
</p:dataTable>

<p:dataTable var="a" value="#{bidMB.listeDeclaration(3,'Exp')}" >
<f:facet name="header">Declarations refusé</f:facet>
<p:column headerText="IdDeclaration">
<p:outputLabel value="#{a.idDeclaration}" />
</p:column>

<p:column headerText="carrier">
<p:outputLabel value="#{a.transporteur.nom}" />
</p:column>

<p:column headerText="prix">
<p:outputLabel value="#{a.price}" />
</p:column>
</p:dataTable>


<p:dataTable var="a" value="#{bidMB.listeMessages()}" >
<f:facet name="header">messages</f:facet>
<p:column headerText="IdMessage">
<p:outputLabel value="#{a.idMessage}" />
</p:column>

<p:column headerText="Objet">
<p:outputLabel value="#{a.objet}" />
</p:column>

<p:column headerText="from">
<p:outputLabel value="#{a.emeteur.email}" />
</p:column>

<p:column headerText="Date">
<p:outputLabel value="#{a.date}" />
</p:column>

</p:dataTable>


</p:panelGrid>
</h:form>
</ui:define>
</ui:composition>